[SPARK-55995][SQL] Support TIMESTAMP WITH LOCAL TIME ZONE in SQL syntax#54813
[SPARK-55995][SQL] Support TIMESTAMP WITH LOCAL TIME ZONE in SQL syntax#54813pan3793 wants to merge 1 commit intoapache:masterfrom
Conversation
|
@gengliangwang could you please take a look? as you are the author of the timestamp ntz |
There was a problem hiding this comment.
+1 for adding this feature, but we need to clarify the reason why we choose this SYNTAX.
For example, could you summarize the DBMS's syntaxes in the PR description, @pan3793 ?
AFAIK, this seems to follow Oracle way, but Apache Spark prefers PostgreSQL way traditionally. In PostgreSQL, it's TIMESTAMP WITH TIME ZONE. For MySQL TIMESTAMP is simply this.
cc @cloud-fan , @yaooqinn , @LuciferYang , @peter-toth , too.
Spark's default timestamp type behaves similarly to |
|
@dongjoon-hyun Yea, as gengliang said, AFAIK, PostgreSQL does not support Additionally, Snowflake and Flink support both https://nightlies.apache.org/flink/flink-docs-release-2.2/docs/dev/table/types/#timestamp_ltz |
|
Thank you for the explanation, @gengliangwang and @pan3793 . |
|
Merged to master for Apache Spark 4.2.0. |
|
late LGTM |
|
Just FYI, the |
|
For the record, the following PR aims to recover |
|
@dongjoon-hyun, thank you for merging and taking care of the CI failure |
What changes were proposed in this pull request?
This PR proposes to add SQL syntax
TIMESTAMP WITH LOCAL TIME ZONEforTimestampType, as a counterpart ofTIMESTAMP WITHOUT TIME ZONEforTimestampNTZType.Why are the changes needed?
Spark SQL supports
TIMESTAMP_LTZas a counterpart ofTIMESTAMP_NTZ, but lacks supportTIMESTAMP WITH LOCAL TIME ZONEas a counterpart ofTIMESTAMP WITHOUT TIME ZONE.Does this PR introduce any user-facing change?
This introduces new SQL syntax without breaking backward compatibility.
How was this patch tested?
New UTs are added.
Was this patch authored or co-authored using generative AI tooling?
No.